list1 = [1, 2, 3, 4, 5]
for i in range(len(list1)):
    print(list1[i], end=' ')
print()
print('----------------------------------')
list1 = [1, 2, 3, 4, 5]
for i in list1:
    print(i, end=' ')
print()
print('----------------------------------')

list1.append(6)
print(list1)
list2 = [7, 8]
list1.extend(list2)
print(list1)
print(list2)
list1.insert(2, 66)
print(list1)
list1.reverse()
list1.sort(reverse=True)

list3 = [14, 22, 3, 4, 5]
list4 = sorted(list3)  # 返回一个新列表,不改变原列表
print(list3)
print(list4)

num = list4.pop()   # 默认删除最后一个元素并返回
print(num)
print(list4)

set1={1,2,3,4,5}
for i in set1:
    print(i,end=' ')
print()

dict1={'name':'zhangsan','age':18}
dict1['sex']='male' # 添加
dict1['age']=19     # 修改
for key,value in dict1.items():
    print(key,value)

